﻿using MESPro.Models;
using MESPro.Models.FunctionType;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Design;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.Automation;
using System.Windows.Forms.Layout;

namespace MESPro.Controls
{
    [RMControlAttribute("文本标签", "RMLabel.ico"),DefaultProperty("Name")]
    public partial class RMLabel : Label,ICustomControl
    {
        public RMLabel()
        {
            InitializeComponent();
            Text = "文本标签";
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
        }
        #region 属性

        [Category("\t\t\t\t\t\t\t\t参数设置"), Description("很重要,用于数据绑定,关联存储过程的参数"), DisplayName("1.控件名"), Browsable(true)]
        public new string Name { get => base.Name; set => base.Name = value; }

        /// <summary>
        /// 
        /// </summary>
        [Category("\t\t\t\t\t\t\t\t参数设置"), Description("显示名称"), DisplayName("2.显示名称"), Browsable(true)]
        public new string Text
        {
            get => base.Text;
            set
            {
                base.Text = value;
                if (App.User is not null)
                {
                    DisLanguage.SetLanguage(App.User.Language, value);
                }
            }
        }

        [Category("\t\t\t\t\t\t\t\t参数设置"),
        Description("点击这个按钮会执行的存储过程"),
        DisplayName("3.存储过程"),
        TypeConverter(typeof(ExpandableObjectConverter)),
        Editor(typeof(PropertyReturnStoreProcedure), typeof(UITypeEditor))]
        [SugarColumn(IsJson = true)]
        public StoreProInfo StoredProcedure { get; set; } = new();

        [TypeConverter(typeof(ExpandableObjectConverter))]
        [Category("\t\t\t\t\t\t\t\t参数设置"), Description("多语言设置"), DisplayName("4.多语言设置"), Browsable(true)]
        public DisLanguage DisLanguage { get; set; } = new DisLanguage() { zh_CN = "标题", en_US = "Title" };

        [DisplayName("固定位置"), Description("固定位置"), Browsable(false)]
        public override AnchorStyles Anchor { get => base.Anchor; set => base.Anchor = value; }

        [DisplayName("定位"), Description("停靠"), Browsable(true)]
        public new Point Location { get => base.Location; set => base.Location = value; }

        [DisplayName("大小"), Description("控件的大小"), Browsable(true)]
        public new Size Size { get => base.Size; set => base.Size = value; }

        [DisplayName("停靠位置"), Description("停靠位置"), Browsable(true)]
        public override DockStyle Dock { get => base.Dock; set => base.Dock = value; }

        [DisplayName("字体设置"), Description("字体设置"), Browsable(false)]
        public override Font Font { get => base.Font; set => base.Font = value; }

        [DisplayName("背景色"), Description("背景色"), Browsable(true)]
        public override Color BackColor { get => base.BackColor; set => base.BackColor = value; }

        [DisplayName("字体颜色"), Description("字体颜色"), Browsable(true)]
        public override Color ForeColor { get => base.ForeColor; set => base.ForeColor = value; }
        [DisplayName("边框样式"), Description("边框样式"), Browsable(true)]
        public override BorderStyle BorderStyle { get => base.BorderStyle; set => base.BorderStyle = value; }

        [Browsable(false)]
        public new Cursor Cursor { get => base.Cursor; set => base.Cursor = value; }

        [Browsable(false)]
        public new bool Visible { get => base.Visible; set => base.Visible = value; }

        [Browsable(false)]
        public new AccessibleRole AccessibleRole { get => base.AccessibleRole; set => base.AccessibleRole = value; }

        [Browsable(false)]
        public new string AccessibleName { get => base.AccessibleName; set => base.AccessibleName = value; }

        [Browsable(false)]
        public new string AccessibleDescription { get => base.AccessibleDescription; set => base.AccessibleDescription = value; }

        [Browsable(false)]
        public new bool TabStop { get => base.TabStop; set => base.TabStop = value; }

        [Browsable(false)]
        public new int TabIndex { get => base.TabIndex; set => base.TabIndex = value; }

        [Browsable(false)]
        public new bool Enabled { get => base.Enabled; set => base.Enabled = value; }
        [Browsable(false)]
        public new FlatStyle FlatStyle { get => base.FlatStyle; set => base.FlatStyle = value; }

        [Browsable(false)]
        public new Image Image { get => base.Image; set => base.Image = value; }

        [Browsable(false)]
        public new ContentAlignment ImageAlign { get => base.ImageAlign; set => base.ImageAlign = value; }

        [Browsable(false)]
        public new int ImageIndex { get => base.ImageIndex; set => base.ImageIndex = value; }

        [Browsable(false)]
        public new string ImageKey { get => base.ImageKey; set => base.ImageKey = value; }

        [Browsable(false)]
        public new ImageList ImageList { get => base.ImageList; set => base.ImageList = value; }

        [Browsable(false)]
        public new ContentAlignment TextAlign { get => base.TextAlign; set => base.TextAlign = value; }


        [Browsable(false)]
        public new bool AutoEllipsis { get => base.AutoEllipsis; set => base.AutoEllipsis = value; }

        [Browsable(false)]
        public new bool UseCompatibleTextRendering { get => base.UseCompatibleTextRendering; set => base.UseCompatibleTextRendering = value; }

        [Browsable(false)]
        public new bool UseMnemonic { get => base.UseMnemonic; set => base.UseMnemonic = value; }
        [Browsable(false)]
        public new bool UseWaitCursor { get => base.UseWaitCursor; set => base.UseWaitCursor = value; }

        [Browsable(false)]
        public new AutomationLiveSetting LiveSetting { get => base.LiveSetting; set => base.LiveSetting = value; }

        [Browsable(false)]
        public override Image BackgroundImage { get => base.BackgroundImage; set => base.BackgroundImage = value; }

        [Browsable(false)]
        public override RightToLeft RightToLeft { get => base.RightToLeft; set => base.RightToLeft = value; }

        [Browsable(false)]
        public override LayoutEngine LayoutEngine => base.LayoutEngine;

        [Browsable(false)]
        public new bool CausesValidation { get => base.CausesValidation; set => base.CausesValidation = value; }

        [Browsable(false)]
        public override bool AutoSize { get => base.AutoSize; set => base.AutoSize = value; }

        [Browsable(false)]
        public new Padding Margin { get => base.Margin; set => base.Margin = value; }

        [Browsable(false)]
        public new Padding Padding { get => base.Padding; set => base.Padding = value; }

        [Browsable(false)]
        public new Size MaximumSize { get => base.MaximumSize; set => base.MaximumSize = value; }

        [Browsable(false)]
        public new Size MinimumSize { get => base.MinimumSize; set => base.MinimumSize = value; }

        [Browsable(false)]
        public override bool AllowDrop { get => base.AllowDrop; set => base.AllowDrop = value; }

        [Browsable(false)]
        public override Point AutoScrollOffset { get => base.AutoScrollOffset; set => base.AutoScrollOffset = value; }

        [Browsable(false)]
        public override BindingContext BindingContext { get => base.BindingContext; set => base.BindingContext = value; }

        //[Browsable(false)]
        //protected override bool CanEnableIme => base.CanEnableIme;
        //[Browsable(false)]
        //public override ContextMenu ContextMenu { get => base.ContextMenu; set => base.ContextMenu = value; }
        [Browsable(false)]
        public override ImageLayout BackgroundImageLayout { get => base.BackgroundImageLayout; set => base.BackgroundImageLayout = value; }

        [Browsable(false)]
        public override ContextMenuStrip ContextMenuStrip { get => base.ContextMenuStrip; set => base.ContextMenuStrip = value; }

        //[Browsable(false)]
        //public override Cursor Cursor { get => base.Cursor; set => base.Cursor = value; }
        [Browsable(false)]
        public new ControlBindingsCollection DataBindings { get => base.DataBindings; }

        [Browsable(false)]
        public new object Tag { get => base.Tag; set => base.Tag = value; }

        [Browsable(false)]
        protected override ImeMode ImeModeBase { get => base.ImeModeBase; set => base.ImeModeBase = value; }

        [Browsable(false)]
        protected override bool CanRaiseEvents => base.CanRaiseEvents;

        #endregion 属性
    }
}
